from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('commodity', '0001_initial'),  # 依赖于之前的迁移
    ]

    operations = [
        migrations.RunSQL(
            sql="""
            CREATE TABLE IF NOT EXISTS commodity_types (
                id INT AUTO_INCREMENT PRIMARY KEY,
                firsts VARCHAR(100) NOT NULL COMMENT '一级分类',
                seconds VARCHAR(100) NOT NULL COMMENT '二级分类'
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
            """,
            reverse_sql="DROP TABLE IF EXISTS commodity_types;"
        )
    ]